﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="WsTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="Foreground" Value="White" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">

                    <Grid x:Name="Root" Margin="6">
                        <Border x:Name="Border"
                                Cursor="Hand"
                                ToolTip="{TemplateBinding ToolTip}"
                                BorderThickness="1"
                                BorderBrush="Transparent"
                                Background="Transparent"
                                Opacity="0.4">

                            <ContentPresenter x:Name="ContentSite"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Left"
                                              ContentSource="Header"
                                              Margin="4"
                                              TextElement.Foreground="White"
                                              TextElement.FontSize="14"
                                              RecognizesAccessKey="True" />
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Opacity" Value="1" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#8f8f8f" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1" />
                            <Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Offset="0.0" Color="#767676" />
                                                <GradientStop Offset="0.3" Color="#6d6d6d" />
                                                <GradientStop Offset="0.7" Color="#6d6d6d" />
                                                <GradientStop Offset="1.0" Color="#767676" />
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="ContentSite" Property="TextElement.Foreground" Value="Black" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition SourceName="Border" Property="IsMouseOver" Value="True" />
                                <Condition Property="IsSelected" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="Border" Property="Opacity" Value="0.8" />
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>

            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="WsTabControlStyle" TargetType="{x:Type TabControl}">
        <Setter Property="TabStripPlacement" Value="Left" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource ResourceKey=WsTabItemStyle}" />
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">

                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled" />
                                <!--<Storyboard>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                                      Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                                <EasingColorKeyFrame KeyTime="0" Value="#FFAAAAAA" />
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>-->
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <!--<TabPanel x:Name="HeaderPanel"
                                  Panel.ZIndex="1"
                                  IsItemsHost="True"
                                  KeyboardNavigation.TabIndex="1"
                                  Background="{StaticResource ResourceKey=ContentsBgBrush}" />-->

                        <Border Background="{StaticResource ResourceKey=ContentsBgBrush}"
                                CornerRadius="6,0,0,6" Padding="0,5,0,5">
                            <TabPanel x:Name="HeaderPanel"
                                      Panel.ZIndex="1"
                                      IsItemsHost="True"
                                      KeyboardNavigation.TabIndex="1" />
                        </Border>

                        <Border x:Name="Border"
                                Grid.Column="1"
                                BorderThickness="1"
                                BorderBrush="{StaticResource ResourceKey=ContentsBgBrush}"
                                Background="White"
                                KeyboardNavigation.TabNavigation="Local"
                                KeyboardNavigation.DirectionalNavigation="Contained"
                                KeyboardNavigation.TabIndex="2">
                            <!--Background="{StaticResource ResourceKey=WsContentAreaBgBrush}"-->

                            <ContentPresenter x:Name="PART_SelectedContentHost"
                                              ContentSource="SelectedContent" />
                            
                        </Border>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>